<?
include('/www/resellers_advanced/login/wallet_db.html');
//translate##############################################################################
$no_clients=translate('no_clients');
$select_user=translate('select_user');
$enter_sld=translate('enter_sld');
$enter_tld=translate('enter_tld');
$choose_period=translate('choose_period');
$choose_payment=translate('choose_payment');
$renew=translate('renew');
//translate##############################################################################
if (!isset($_POST[form_submit])) {
	//-----------------------------------------------------
        $sql['type'] = "SELECT";
        $sql['params'] = "client_id, username, firstname, lastname";
        $sql['table'] = "clients";
        $sql['where'] = "reseller_id='$id' AND blocked=0";
        $sql['options'] = "ORDER BY username";
        $sql['return'] = "struct";
        //------------------------------------------------------
        if (!$result=sql_exec($sql,$dbh81,'assoc')) {
                exit($no_clients);
        }
        foreach ($result as $value) {
                $clients[$value[client_id]]=$value[username];
        }
        $params[sid] = $sid;
        $params[action] = 'changedetails';
        $return_url = "$baseURL/$webDIR/?".encode_params($params);
	$action_url='https://supremeserver1.com/resellers/u/order/order_domain_renewal.php';
        echo "<table class='bTable' cellspacing=0>
        <form action=\"$action_url\" method=POST>
        <tr>
                <th align=left>$select_user :</th>
                <th align=left>$enter_sld :</th>
                <th align=left>$enter_tld :</th>
                <th align=left>$choose_period :</th>
        </tr>
        <tr>
                <td><select name=username>
                        <option value=''>-----------</option>\n";
                foreach ($clients as $value) {
                        echo "<option value='$value'>$value</option>\n";
                }
                echo "</select></td>
                <td><input type='text' name='sld' value='$_POST[sld]' size=15 maxlength=20></td>
                <td><select name=tld>
                                <option value='com'>.com</option>
                                <option value='net'>.net</option>
                                <option value='org'>.org</option>
                                <option value='biz'>.biz</option>
                                <option value='us'>.us</option>
                                <option value='info'>.info</option>
                </select></td>
		<td><select name=period>
			<option value=1>1 Year</option>
			</select></td>
        </tr>
	<tr>
		<th colspan=4 align =center>$choose_payment :</th>
	</tr>
	<tr>
		<td colspan=4 align=center>";
		if(!$_POST[payment_method]) $_POST[payment_method]='cc';
                            echo "<input type=radio name=payment_method value='cc'"; if($_POST[payment_method]=='cc') echo 'checked'; echo ">Credit Card
                            <input type=radio name=payment_method value='pp'"; if($_POST[payment_method]=='pp') echo 'checkd'; echo " >PayPal
                            <input type=radio name=payment_method value='wallet'"; if($_POST[payment_method]=='wallet') echo 'checkd'; echo " >Wallet
	</tr>
        <tr>
                <td colspan=4 align=center><input type='submit' name='submit' value='$renew'>
                        <input type='hidden' name='return_url' value='$return_url'>
                        <input type='hidden' name='form_submit' value='yes'></td>
        </tr>
        </form>";
}
?>
